CONSOLE-4954: Add Workload tab to Node view#16574
Conversation
|
@jeff-phillips-18: This pull request references CONSOLE-4954 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThis PR introduces a "Workload" tab to the Node Details page that displays pods running on a specific node. The change extends PodsPage with a ChangesNode Workload Tab Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jeff-phillips-18 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx (1)
61-72: ⚡ Quick winAdd an assertion for forwarded
PodsPageprops from the standard page component.Current checks validate tab metadata, but they don’t verify the behavior that matters most here: Line 11 in
NodeWorkload.tsx(fieldSelector) and Line 13 (hideFavoriteButton) reachingPodsPage. Consider invokingcall.standardPages[0].component({ obj: mockNode })and asserting the mockedPodsPagereceived those props.As per coding guidelines, “Make sure the tests pass, and add any new tests as appropriate.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx` around lines 61 - 72, Invoke the standard page component returned from NodeSubNavPage (call.standardPages[0].component) with { obj: mockNode } and assert that the mocked PodsPage received the forwarded props: verify (PodsPage as jest.Mock).mock.calls includes a call whose first arg contains the expected fieldSelector and hideFavoriteButton values from NodeWorkload; keep the existing metadata assertions and add this props assertion to ensure NodeWorkload forwards fieldSelector and hideFavoriteButton to PodsPage.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx`:
- Around line 61-72: Invoke the standard page component returned from
NodeSubNavPage (call.standardPages[0].component) with { obj: mockNode } and
assert that the mocked PodsPage received the forwarded props: verify (PodsPage
as jest.Mock).mock.calls includes a call whose first arg contains the expected
fieldSelector and hideFavoriteButton values from NodeWorkload; keep the existing
metadata assertions and add this props assertion to ensure NodeWorkload forwards
fieldSelector and hideFavoriteButton to PodsPage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4c47d5c7-2087-4c32-8a47-90d3c6c954f9
📒 Files selected for processing (7)
frontend/packages/console-app/locales/en/console-app.jsonfrontend/packages/console-app/src/components/nodes/NodeDetailsPage.tsxfrontend/packages/console-app/src/components/nodes/NodeWorkload.tsxfrontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsxfrontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.mdfrontend/packages/console-dynamic-plugin-sdk/src/extensions/node.tsfrontend/public/components/pod-list.tsx
|
/test e2e-playwright |
|
@jeff-phillips-18: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |

Closes CONSOLE-4954, CONSOLE-4955
Note
This feature is available in Tech Preview only.
Analysis / Root cause:
The Node details page needed a Workload tab to organize workload-related information (initially Pods) separately from the existing tabs. This follows the pattern established with the Configuration tab which has sub-tabs for Storage and Machine.
Solution description:
NodeWorkloadcomponent that usesNodeSubNavPageto provide a Workload tab with a Pods sub-tabFLAG_NODE_MGMT_V1feature flag is enabled (bare metal nodes)hideFavoriteButtonprop toPodsPagecomponent to allow hiding the favorite button in nested contextsconsole.node/sub-nav-tabextension documentation to include the new workloads parent tab with pods/30 priorityNodeWorkloadcomponentNodeDetailsPageto conditionally include the Workload tab and adjust tab ordering based on feature flag stateScreenshots / screen recording:

Test setup:
FLAG_NODE_MGMT_V1feature flag enabledTest cases:
FLAG_NODE_MGMT_V1is enabled, verify Workload tab appears in node details navigationFLAG_NODE_MGMT_V1is disabled, verify Pods appears as a top-level tab (legacy behavior)Browser conformance:
Additional info:
This change maintains backward compatibility by conditionally showing either the new Workload tab (with Pods as a sub-tab) or the legacy standalone Pods tab based on the feature flag state.
Reviewers and assignees:
Console Approver:
/assign @jhadvig
Docs approver:
/assign @jseseCCS
PX approver:
/assign @rh-joshbeverly
🤖 Generated with https://claude.com/claude-code
Summary by CodeRabbit